package com.simple.microservices.web.active;


import com.simple.microservices.api.active.BlindBoxService;
import com.simple.microservices.commons.utils.Response;
import com.simple.microservices.dao.dataobject.SpotPool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author hyf
 * @date 2021/10/11
 */
@RestController
@RequestMapping("/active/miss/spotPool")
public class SpotPoolController {

    @Resource
    private BlindBoxService blindBoxService;

    /**
     * 获取小纸条
     *
     * @param userId
     * @param sex
     * @return
     */
    @GetMapping("getSpot")
    @ResponseBody
    public Response getSpot(Long userId, String sex) {
        SpotPool spotPool =  blindBoxService.getSpot(userId,sex);
        return Response.success(spotPool);
    }

    /**
     * 保存添加/修改的数据
     */
    @PostMapping("/saveSpot")
    @ResponseBody
    public Response saveSpot( @RequestBody SpotPool spotPool) {
         blindBoxService.saveSpot(spotPool);
         return Response.successMsg("操作成功");
    }




}